﻿using System;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Carozos.BE;
using Carozos.Mok;

namespace Carozos.Test
{
    [TestClass]
    public class InsumoMoq
    {
        [TestMethod]
        public void RegistroInsumoCorrecto()
        {
            InsumoBC inbc = new InsumoBC(new FalsoInsumoDALC());
            bool valor = inbc.insertaInsumo(new InsumoBE(1));
            Assert.AreEqual(true, valor);
        }

        [TestMethod]
        public void RegistroInsumoIncorrecto()
        {
            InsumoBC inbc = new InsumoBC(new FalsoInsumoDALC());
            bool valor = inbc.insertaInsumo(new InsumoBE(1));
            Assert.AreEqual(false, valor);
        }

        [TestMethod]
        public void ActualizacionInsumoCorrecto()
        {
            InsumoBC inbc = new InsumoBC(new FalsoInsumoDALC());
            bool valor = inbc.actualizarInsumo(new InsumoBE(1));
            Assert.AreEqual(true, valor);
        }

        [TestMethod]
        public void ActualizacionInsumoIncorrecto()
        {
            InsumoBC inbc = new InsumoBC(new FalsoInsumoDALC());
            bool valor = inbc.actualizarInsumo(new InsumoBE(1));
            Assert.AreEqual(false, valor);
        }

        [TestMethod]
        public void EmilinacionInsumoCorrecto()
        {
            InsumoBC inbc = new InsumoBC(new FalsoInsumoDALC());
            bool valor = inbc.eliminaInsumo(1);
            Assert.AreEqual(true, valor);
        }

        [TestMethod]
        public void EmilinacionInsumoIncorrecto()
        {
            InsumoBC inbc = new InsumoBC(new FalsoInsumoDALC());
            bool valor = inbc.eliminaInsumo(1);
            Assert.AreEqual(false, valor);
        }

        [TestMethod]
        public void obtenerInsumosPorNombreCorrecta()
        {
            InsumoBC inbc = new InsumoBC(new FalsoInsumoDALC());
            List<InsumoBE> lista = inbc.getInsumosByNombre("A");
            Assert.AreEqual(2,lista.Count);
        }

        [TestMethod]
        public void obtenerInsumosPorNombreIncorrecta()
        {
            InsumoBC inbc = new InsumoBC(new FalsoInsumoDALC());
            List<InsumoBE> lista = inbc.getInsumosByNombre("B");
            Assert.AreEqual(2, lista.Count);
        }

        [TestMethod]
        public void actualizaStockInsumoCorrecto()
        {
            InsumoBC inbc = new InsumoBC(new FalsoInsumoDALC());
            bool valor = inbc.actualizarStockInsumo(1,2);
            Assert.AreEqual(true,valor);
        }

        [TestMethod]
        public void actualizaStockInsumoIncorrecto()
        {
            InsumoBC inbc = new InsumoBC(new FalsoInsumoDALC());
            bool valor = inbc.actualizarStockInsumo(1, 2);
            Assert.AreEqual(false, valor);
        }

    }
}
